//入库单号、入库状态、仓库代码、仓库名称、入库件数、入库重量、入库日期、供应商名称、采购合同号、入库类型、入库码单号、备注
function getStorageFileListOptions(options) {
    var initOptions = {
        idField: 'paidAppNumber',
        columns: [[{
            checkbox: true
        },{
            field: 'storageCode',
            title: '入库单号',
            width: 110
        }, {
            title: '入库状态',
            field: 'storageStatus',
            width: 60
        }, {
            field: 'warehouseCode',
            title: '仓库代码',
            width: 60
        }, {
            field: 'warehouseName',
            title: '仓库名称',
            width: 60
        }, {
            field: 'storagePage',
            title: '入库件数',
            width: 80,
            align: 'right'
        }, {
            field: 'storageWeight',
            title: '入库重量',
            width: 60,
            align: 'right',
            formatter: function (value, rowData, rowIndex) {//格式化该字段内的显示
                return formatWeight(value);
            }
        },  {
            field: 'storageDate',
            title: '入库日期',
            width: 70
        }, {
            field: 'providerName',
            title: '供应商名称',
            width: 110
        }, {
            field: 'contractCode',
            title: '采购合同号',
            width: 110
        }, {
            field: 'storageType',
            title: '入库类型',
            width: 110
        }, {
            field: 'storageMdCode',
            title: '入库码单号',
            width: 110
        },{
            field: 'remark',
            title: '备注',
            width: 110
        }]],
        onCheck:function(rowIndex,rowData){
            setStorageTopStatus(rowData.storageStatus);
        }
    }
    if (options != undefined) {
        $.extend(initOptions, options);
    }
    return initOptions;
}

//查看明细 approve.jsp
function viewStorageDocFunction(id) {
    var options = {
        "width":980,"height":600,
        buttons: [{
            id: "cancelStorageDoc",
            text: '撤销入库单',
            handler: function () {
                parent.$.modalDialog.openner_treeGrid = $('#dataGrid');//因为添加成功之后，需要刷新这个treeGrid，所以先预定义好
            }
        },{
            text: '返回',
            handler: function () {
                parent.$.modalDialog.handler.dialog('close');
            }
        }]}
    if(id){
        options.id=id;
        editFun('查看入库单明细', '/storage/storageDocView.html?id=',$('#dataGrid'), options);
    }else{
        var select = $('#dataGrid').datagrid('getSelections');
        if (select&&select.length>0) {
            editFun('查看入库单明细', '/storage/storageDocView.html?id=',$('#dataGrid'), options);
        } else {
            parent.$.messager.alert('提示', '请选择一条数据.', 'info');
        }
    }
}



function printStorageFileFunction(){

}

//按钮able状态
function setStorageTopStatus(status){
    var nodeArray = [$("#changeStorageFileFunction")];
    if (status === "确认") {
        setLinkButtonStatus(nodeArray, [1]);
    }else{
        setLinkButtonStatus(nodeArray, [0]);}
}